#pragma once

#include "Account_t.h"
#include "RegularAccount_t.h"
#include "FamilyAccount_t.h"
#include "StockAccount_t.h"
using namespace std;

class AccountFactory {
public:
	static AccountImpl* CreateAccount(Bank_t* b, int accountType, int percent, int date, int period) {
		AccountImpl* ptrAccount = 0;

		switch(accountType) {
		case Regular_e: 
			ptrAccount = new RegularAccount_t(b, percent, date, period); break;
		case Family_e:
			ptrAccount = new FamilyAccount_t(b, percent, date, period); break;
		case Stock_e:
			ptrAccount = new StockAccount_t(b, percent, date, period); break;
		}

		return ptrAccount;
	}

private:
	~AccountFactory();
	AccountFactory();
	AccountFactory(const AccountFactory&);
	AccountFactory& operator=(const AccountFactory&);
};